<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=`, initial-scale=1.0">
	<title>dome</title>
	<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
	<div id="root">
		<input type="button" value="cool" @click="cool">
		<input type="button" value="rush" @click="rush">
		<h1 @click="show">{{msg}}</h1>
	</div>

	<script type="text/javascript">
		const vm = new Vue({
			el:"#root",
			data:{
				msg:"雀氏蟀,666啊",
				name:"dagoose",
				interval:null,
			},
			methods:{
				show(){
					alert("www.dagoose.com")
				},
				cool(){
					if (this.interval != null) {return}
					this.interval = setInterval(()=>{
						console.log(this.msg);
						let start = this.msg.substring(0,2);
						let end = this.msg.substring(2);
						this.msg = end + start;
					} ,400)
					
				},
				rush(){
					clearInterval(this.interval)
					this.interval = null;
				}
			},
		})
	</script>
</body>
</html>